/**
 * Name        : FileDialogNew.h
 * Version     : 1.0.0
 * Vendor      : badadev.com
 * Description : Component for creating new files/directories
 * Lincense    : This program is free software. It comes without any warranty, to
 *               the extent permitted by applicable law. You can redistribute it
 *               and/or modify it under the terms of the Do What The Fuck You Want
 *               To Public License, Version 2, as published by Sam Hocevar. See
 *               http://sam.zoy.org/wtfpl/COPYING for more details.
 */

#include <FBase.h>
#include <FGraphics.h>
#include <FUi.h>
#include <FIo.h>
#include <FContent.h>

#include "InheritanceContainer.h"

#ifndef FILEDIALOGNEW_H_
#define FILEDIALOGNEW_H_

namespace badadev
{
class FileDialogNew:
	public Osp::Ui::Controls::Popup,
	public InheritanceContainer,
	private Osp::Ui::IActionEventListener {
public:

	static const int ON_CANCEL = 5101;
	static const int ON_CREATE = 5102;
	static const int ON_CREATE_FILE_TRUE = 5103;
	static const int ON_CREATE_FILE_FALSE = 5104;
	static const int ON_CREATE_FOLDER_TRUE = 5105;
	static const int ON_CREATE_FOLDER_FALSE = 5106;

	FileDialogNew();
	virtual ~FileDialogNew();
	void Initialize(const Osp::Base::String & title, InheritanceContainer &parent,
				        Osp::Base::String &path, Osp::Base::String ext, const Osp::Graphics::Dimension d);
	Osp::Base::String GetNewFilePath(){ return newfilepath_;}
	Osp::Base::String GetNewFolderPath(){ return newfolderpath_;}
private:

	Osp::Ui::Controls::Button * btCancel_;
	Osp::Ui::Controls::Button * btCreate_;
	Osp::Ui::Controls::CheckButton * cbtFile_;
	Osp::Ui::Controls::CheckButton * cbtFolder_;
	Osp::Ui::Controls::RadioGroup * cbtGroup_;
	Osp::Ui::Controls::Label * lbName_;
	Osp::Ui::Controls::EditField * efName_;


	Osp::Base::String path_;
	Osp::Base::String supportExt_;
	Osp::Base::String newfilepath_;
	Osp::Base::String newfolderpath_;

	void OnActionPerformed(const Osp::Ui::Control& source, int actionId);
	void OnOrientationChanged( const Osp::Ui::Control &source, Osp::Ui::OrientationStatus orientationStatus );
};
}

#endif /* FILEDIALOGNEW_H_ */
